Next | Prev | Up | Top | Contents | Index

Creating Device Special Files

For each VECTOR line in /var/sysgen/system/ramdrive.sm you can create a pair of device special files, one block device and one character device. Each file's inode contains the major device number established in descriptive file /var/sysgen/master.d/ramdrive, and a minor number between 0 and 1 less than the limit established in the descriptive file.

The preferred command is install (see the install(1) reference page). The commands in Example 12-3 show the creation of the character and block devices for minor device number 0. The files created are /dev/ramblk0 and /dev/ramchr0.

Example 12-3 : Install Command to Create Device Special File

# install -u root -g sys -f /dev -blk 77,0 ramblk0
# install -u root -g sys -f /dev -chr 77,0 ramchr0
In addition to device special files, you need to create ordinary directories that can be used as mount points for the mounted filesystem, for example

# mkdir /RAM0

The example driver supports as many minor device numbers as you specify in the descriptive file /var/sysgen/master.d/ramdrive. You can create as many device special files that contain the example driver's major number as you like--or as few. Device special files are independent of the driver configuration until they are opened. However,


Next | Prev | Up | Top | Contents | Index